package com.util;


import org.springframework.stereotype.Component;

@Component
public class AuthenticationProviderUtil{// implements AuthenticationProvider
    /*@Resource
    private UserServiceImplDetail userServiceImplDetail;

    @Override
    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        String username = authentication.getPrincipal().toString();
        String password = authentication.getCredentials().toString();
        User user = userServiceImplDetail.loadUserByUsername(username);
        if (!user.getPassword().equals(password)){
            throw new BadCredentialsException("账号或密码错误");
        }
        return new UsernamePasswordAuthenticationToken(user.getUsername(),user.getPassword(),user.getAuthorities());
    }

    @Override
    public boolean supports(Class<?> aClass) {
        return aClass.equals(UsernamePasswordAuthenticationToken.class);
    }*/

}
